package reflect;
 import reflect.annotations.AutoRunClass;
 import reflect.annotations.AutoRunMethod;

@AutoRunClass
public class Person {
    private String name;
    private String info;
    private int age;
    private char sex;
    public Person( String name, int age, char sex) {
        this.name = name;
        this.age = age;
        this.sex = sex;
    }

    public Person(String name) {
        this(name, 18, '男');
    }

    public Person() {
        this("张三", 18, '男');
    }

    @Override
    public String toString() {
        return  "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", sex=" + sex +
                '}';
    }

    private void hehe(){
        System.out.println("我是Person的私有方法haha");
    }
    @AutoRunMethod( 1)
    public void swing(){
        System.out.println(name + "正在游泳");
    }
    public void playPhone(){
        System.out.println(name + "正在玩手机");
    }
    @AutoRunMethod( 2)
    public void sayHello() {
        System.out.println(name + "hello！");
    }
    @AutoRunMethod(3)
    public void sayHi() {
        System.out.println(name + "hi！");
    }

    public void doSome() {
        System.out.println(name + "做某事");
    }

    public void sleep() {
        System.out.println(name + "睡觉");
    }

    @AutoRunMethod(4)
    public void watchTv() {
        System.out.println(name + "看电视");
    }

    public void studey() {
        System.out.println(name + "学习");
    }
    @AutoRunMethod(5)
    public void playGame() {
        System.out.println(name + "玩游戏");
    }

    public void sing() {
        System.out.println(name + "唱歌");
    }

    public void say(String info) {
        System.out.println(name + "" + info);
    }

    public void say(String info, int count) {
        for (int i = 0; i < count; i++) {
            System.out.println(name + ":" + info);
        }
    }
}
